import 'package:love_newf/generated/json/base/json_convert_content.dart';
import 'package:love_newf/app/com/model/user_setting_model.dart';

UserSettingModel $UserSettingModelFromJson(Map<String, dynamic> json) {
  final UserSettingModel userSettingModel = UserSettingModel();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    userSettingModel.id = id;
  }
  final int? userId = jsonConvert.convert<int>(json['userId']);
  if (userId != null) {
    userSettingModel.userId = userId;
  }
  final int? voiceInvite = jsonConvert.convert<int>(json['voiceInvite']);
  if (voiceInvite != null) {
    userSettingModel.voiceInvite = voiceInvite;
  }
  final int? vipOnlineNotice = jsonConvert.convert<int>(
      json['vipOnlineNotice']);
  if (vipOnlineNotice != null) {
    userSettingModel.vipOnlineNotice = vipOnlineNotice;
  }
  final int? videoSwitch = jsonConvert.convert<int>(json['videoSwitch']);
  if (videoSwitch != null) {
    userSettingModel.videoSwitch = videoSwitch;
  }
  final int? privateChatSwitch = jsonConvert.convert<int>(
      json['privateChatSwitch']);
  if (privateChatSwitch != null) {
    userSettingModel.privateChatSwitch = privateChatSwitch;
  }
  final int? recommendSwitch = jsonConvert.convert<int>(
      json['recommendSwitch']);
  if (recommendSwitch != null) {
    userSettingModel.recommendSwitch = recommendSwitch;
  }
  final int? videoTokens = jsonConvert.convert<int>(json['videoTokens']);
  if (videoTokens != null) {
    userSettingModel.videoTokens = videoTokens;
  }
  final int? hideGuard = jsonConvert.convert<int>(json['hideGuard']);
  if (hideGuard != null) {
    userSettingModel.hideGuard = hideGuard;
  }
  final int? hideLovers = jsonConvert.convert<int>(json['hideLovers']);
  if (hideLovers != null) {
    userSettingModel.hideLovers = hideLovers;
  }
  final int? enableLog = jsonConvert.convert<int>(json['enableLog']);
  if (enableLog != null) {
    userSettingModel.enableLog = enableLog;
  }
  return userSettingModel;
}

Map<String, dynamic> $UserSettingModelToJson(UserSettingModel entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['userId'] = entity.userId;
  data['voiceInvite'] = entity.voiceInvite;
  data['vipOnlineNotice'] = entity.vipOnlineNotice;
  data['videoSwitch'] = entity.videoSwitch;
  data['privateChatSwitch'] = entity.privateChatSwitch;
  data['recommendSwitch'] = entity.recommendSwitch;
  data['videoTokens'] = entity.videoTokens;
  data['hideGuard'] = entity.hideGuard;
  data['hideLovers'] = entity.hideLovers;
  data['enableLog'] = entity.enableLog;
  return data;
}

extension UserSettingModelExtension on UserSettingModel {
  UserSettingModel copyWith({
    int? id,
    int? userId,
    int? voiceInvite,
    int? vipOnlineNotice,
    int? videoSwitch,
    int? privateChatSwitch,
    int? recommendSwitch,
    int? videoTokens,
    int? hideGuard,
    int? hideLovers,
    int? enableLog,
  }) {
    return UserSettingModel()
      ..id = id ?? this.id
      ..userId = userId ?? this.userId
      ..voiceInvite = voiceInvite ?? this.voiceInvite
      ..vipOnlineNotice = vipOnlineNotice ?? this.vipOnlineNotice
      ..videoSwitch = videoSwitch ?? this.videoSwitch
      ..privateChatSwitch = privateChatSwitch ?? this.privateChatSwitch
      ..recommendSwitch = recommendSwitch ?? this.recommendSwitch
      ..videoTokens = videoTokens ?? this.videoTokens
      ..hideGuard = hideGuard ?? this.hideGuard
      ..hideLovers = hideLovers ?? this.hideLovers
      ..enableLog = enableLog ?? this.enableLog;
  }
}